package com.itheima.service.impl;

import com.itheima.entity.User;
import com.itheima.service.UserService;
import org.apache.dubbo.config.annotation.Service;

/**
 * @program: dubbo-pro
 * @description:
 * @author: zhanghz001
 * @create: 2021-02-06 09:35
 **/
//后面改成dubbo的service服务
// @Service(timeout = 3000, retries = 1)
// @Service(version = "v1.0")
@Service
public class UserServiceImpl implements UserService {
    public String sayHello() {
        return "hello dubbo!~";
    }
    
    public User findUserById(int id) {
        System.out.println("9004");
        // System.out.println("9005");
        // System.out.println("9006");
        //查询User对象
        User user = new User(1, "zhangsan-v1.0", "123-v1.0");
        //超时配置
        // try {
        //     Thread.sleep(4000);
        // } catch (Exception e) {
        //     e.printStackTrace();
        // } finally {
        //    
        // }
        //异常设置
        int i = 1 / 0;
        return user;
    }
}
